﻿@model AlbumSectionDetailsViewModel
@{
    Layout = "~/Views/Shared/PublicLayout.cshtml";
    ViewBag.Title = "פרויקט - " + Model.Album.Title + " - " + Model.AlbumSection.SectionTitle;
}
@section headElements{
    <link href="@Url.Content("~/Content/AlbumEditorView.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/AlbumSectionEditorView.js")" type="text/javascript"></script>
}
@{
    var AllowEditSection = false;
    var AllowApproveSection = false;

    if (Model.Album.AlbumLockStatusId != 1)
    {
        if (Model.AlbumSection.AlbumSectionLockStatusId == 3)
        {
            AllowEditSection = true;
            if (Model.AlbumSection.AlbumSectionStatusId == 1)
            {
                AllowApproveSection = true;
            }
        }
    }
}
@Html.Hidden("AlbumSectionId", Model.AlbumSection.AlbumSectionId)
<div id="extraDetails">
    <div class="extraDetailsContainer">
        <div class="label">
            תאריך סיום הספר:
        </div>
        <div class="value">
            @Model.Album.DueDate
        </div>
    </div>
    <div class="topSpace">
    </div>
    <a href="@Url.Action("Logout", "Users")" id="logoutUser"></a>
</div>
<div id="mainSection">
    <div id="albumDetailsContainer">
        <div id="albumDetails">
            <div id="albumTitle">@Model.Album.Title</div>
        </div>
        <div id="actionsContainer">
            <div id="albumStatusDesc">
                מצב נעילה:
                @Model.Album.AlbumLockStatus
                <br />
                סטטוס: @Model.Album.AlbumStatus
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
    <div id="scrollbarContainer">
        <ul id="Sections" class="sectionEditorView">
            <li>
                <div class="paper">
                </div>
                <div class="paperContent">
                    <div class="isLocked locked@(Model.AlbumSection.AlbumSectionLockStatusId)" title="סטטוס נעילה: @(Model.AlbumSection.AlbumSectionLockStatus)">
                    </div>
                    <div class="albumSectionTitle">
                        @Model.AlbumSection.SectionTitle
                    </div>
                    <ul class="buttonsContainer">
                        <li
                @if (!AllowEditSection)
                {
                    <text>class="disabled"</text>   
                }
                ><a class="btnAlbumSectionDesigner"
                @if (AllowEditSection)
                {
                 <text>title="עיצוב מקטע" href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId, AlbumSectionId = Model.AlbumSection.AlbumSectionId })"</text>   
                }
                else
                {
                 <text>title="לא ניתן לעצב את המקטע בשלב זה"</text>   
                }
                ></a></li>
                        <li><a href="@Url.Action("Index", "Designer", new { AlbumId = Model.Album.AlbumId, AlbumSectionId = Model.AlbumSection.AlbumSectionId, designerAction = "Preview" })" class="btnPreviewSection" title="תצוגה מקדימה">
                        </a></li>
                        <li
                @if (!AllowApproveSection)
                {
                    <text>class="disabled"</text>
                }
                ><a class="btnApproveAlbumSection" href="" 
                @if (!AllowApproveSection)
                {
                    <text>title="לא ניתן לאשר את המקטע בשלב זה"</text>
                }
                else
                {
                 <text>title="אישור מקטע"</text>   
                }
                ></a></li>
                    </ul>
                </div>
            </li>
        </ul>
    </div>
    <div id="bottomLegend">
    </div>
</div>
